Socket
Socket
Sign inDemoInstall

json-pointer

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-pointer

Some utilities for JSON pointers described by RFC 6901


Version published
Weekly downloads
1.3M
increased by2.15%
Maintainers
2
Weekly downloads
 
Created

What is json-pointer?

The json-pointer npm package provides utilities for manipulating JSON data using JSON Pointers, which are strings that reference specific locations within a JSON document. This package allows you to get, set, and remove values in JSON objects using these pointers.

What are json-pointer's main functionalities?

Get Value

This feature allows you to retrieve a value from a JSON object using a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
const value = jsonPointer.get(obj, '/foo/bar');
console.log(value); // Output: 'baz'

Set Value

This feature allows you to set a value in a JSON object at the location specified by a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.set(obj, '/foo/bar', 'qux');
console.log(obj); // Output: { foo: { bar: 'qux' } }

Remove Value

This feature allows you to remove a value from a JSON object at the location specified by a JSON Pointer string.

const jsonPointer = require('json-pointer');
const obj = { foo: { bar: 'baz' } };
jsonPointer.remove(obj, '/foo/bar');
console.log(obj); // Output: { foo: {} }

Other packages similar to json-pointer

FAQs

Package last updated on 17 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc